using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace WindowsApplication4
{

    public class VillageIntel
    {
        public DataRow drIntel;
        public VillageIntel(DataRow drIntel)
        {
            this.drIntel = drIntel;
        }

        public DateTime LastCheckeOn
        {
            get
            {
                return (DateTime)drIntel[World.CONSTS.ReportsTable.Columns.LastCheckedOn];
            }
        }

        public DateTime ReportOn
        {
            get
            {
                return (DateTime)drIntel[World.CONSTS.ReportsTable.Columns.ReportOn];
            }
        }

        public double ReportAgeInDays
        {
            get
            {
                return DateTime.Now.Subtract(ReportOn).TotalDays;
            }
        }

        public string  ReportFrom
        {
            get
            {
                return (String)drIntel[World.CONSTS.ReportsTable.Columns.ReportFrom];
            }
        }


        internal void Delete()
        {
            drIntel.Delete();
            drIntel.AcceptChanges();
        }
    }
}
